From b3ec0ca6b6b4f2d8ee68e7aa655be8a859b9125d Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Thu, 12 Oct 2006 16:12:10 +0100 Subject: [PATCH] [HVM][SVM] Check if SVM is disabled by the BIOS before enabling it. Newer BIOS implementations will be able to disable the SVM feature, although an additional test of an MSR (VMCR 0xC0010114 bit 4) is necessary (set equals disabled). Bit 4 of MSR 0xc0010114 returns 0 (SVM enabled) on machines with older BIOS' without the SVM disable feature support. Signed-off-by: Wei Huang =20 Signed-off-by: Tom Woller =20 --- xen/arch/x86/hvm/svm/svm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 6d67980af4..ca4f8d52ae 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -840,6 +840,13 @@ int start_svm(void) if (!(test_bit(X86_FEATURE_SVME, &boot_cpu_data.x86_capability))) return 0; + + /* check whether SVM feature is disabled in BIOS */ + rdmsr(0xC0010114, eax, edx); + if ( eax & 0x00000010 ) { + printk("AMD SVM Extension is disabled in BIOS.\n"); + return 0; + } if (!(hsa[cpu] = alloc_host_save_area())) return 0; -- 2.30.2